package com.ldz.redis;

import com.ldz.redis.model.LikeTask;
import com.ldz.redis.utils.MyUtile;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import redis.clients.jedis.Jedis;

import java.util.ArrayList;

@SpringBootApplication
public class RedisApplication {
    ArrayList<String> arrayList = new ArrayList<>();

    public static void main(String[] args) {
        //连接redis
        Jedis jedis = new Jedis("host",16379);
        jedis.auth("root");
        //模拟请求 创建task
        LikeTask likeTask = new LikeTask("as00003","as00005");

        //序列化 存到redis中
        jedis.lpush("LikeTask",MyUtile.serialize(likeTask));

        //模拟直接返回信息
        System.out.println("return success");
    }




}
